<template>
    <div>
        <div class="title">
            <h2>精品课程
                <a href="#" class="chose-more">
                    更多
                    <img src="../../../assets/right.png" alt="">
                </a></h2>
        </div>
        <ul class="boutiqueList">
            <li v-for="(item) in boutiquesData" :key="item.courseId">
                <router-link :to="{path:'/course',query:{id:item.courseId}}" >
                <div><a href="#"><img :src="item.bannerFileUrl" alt=""></a></div>
                <p>{{item.courseTitle}}</p>
                <p>共{{item.courseId}}节课 | {{item.participationsCount}}人报名</p>
                <span>&yen;&nbsp;{{item.coursePrice}}</span>
                </router-link>
            </li>
        </ul>
    </div>
</template>

<script>
    import {getCourse} from "../../../api";

    export default {
        name: "boutiqueCourse",
        data() {
            return{
                boutiquesData: [],//精品课程数据列表
            }
        },
        methods:{

        },
        created() {
            getCourse("boutique","1",5).then(res=>{
                this.boutiquesData = res.rows;
            }).catch(err=>{
                console.log(err)
            })
        },
    }
</script>

<style scoped lang="less">
    * {
        margin: 0;
        padding: 0;
    }

    ul li {
        list-style: none;
    }

    .freeList,
    .discountList,
    .boutiqueList {
        width: 1200px;
        margin: auto;
    }

    h2 {
        text-align: center;
        margin-top: 50px;
    a {
        float: right;
        color: #999!important;
        font-size: 16px;
        line-height: 40px;
        font-weight: 400;
    }
    }

    .title {
        margin: auto;
        width: 1200px;
        padding: 0 12px 10px 62px;
        border-bottom: 2px solid #e8e8e8;
    }

    .boutiqueList {
        overflow: hidden;
    }

    .boutiqueList>li {
        float: left;
        padding: 8px;

    }

    .boutiqueList>li div {
        overflow: hidden;
        width: 224px;
        height: 135px;
    }

    .boutiqueList>li div>a>img {
        position: relative;
        width: 100%;
        height: 100%;
        transition: 1s;
    }

    .boutiqueList>li div>a>img:hover {
        transform: scale(1.2, 1.2);
    }

    .boutiqueList>li p:nth-of-type(1) {
        width: 200px;
        padding-top: 10px;
        font-weight: 500;
        color: #000;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .boutiqueList>li p:nth-of-type(2) {
        color: #888;
        font-weight: 500;
    }

    .boutiqueList>li span {
        color: #ff4500;
        font-size: 16px;
    }

    .boutiqueList>li:hover {
        cursor: pointer;
    }

    .boutiqueList>li:hover p:nth-of-type(1) {
        color: #00cf8c;
    }
</style>